﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;
using Com.CMS263.PO;
using System.Collections.Generic;
using Com.CMS263.BLL;
using Com.CMS263.Util;

namespace Com.CMS263.Web.xiaoqu
{
    public partial class index : System.Web.UI.Page
    {
        public IList<Community> list = new List<Community>();
        CommunityBLL cbll = new CommunityBLL();
        int pagesize = 20;
        int page = 0;
        public int count = 0;
        public string sort = "0";
        public string key = "";
        public string area = "";
        public string price = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            page = Convert.ToInt32(Request["page"]);
            if (page == 0)
            {
                page = 1;
            }
            sort = Request["sort"];
            key = Request["key"];
            area = Request["area"];
            price = Request["price"];
            if (string.IsNullOrEmpty(sort))
            {
                sort = (string)Session["xiaoqusort"];
            }
            else
            {
                Session["xiaoqusort"] = sort;
            }
            if (string.IsNullOrEmpty(key))
            {
                key = (string)Session["xiaoqukey"];
            }
            else
            {
                Session["xiaoqukey"] = key;
            }
            if (string.IsNullOrEmpty(area))
            {
                area = (string)Session["xiaoquarea"];
            }
            else
            {
                Session["xiaoquarea"] = area;
            }
            if (string.IsNullOrEmpty(price))
            {
                price = (string)Session["xiaoquprice"];
            }
            else
            {
                Session["xiaoquprice"] = price;
            }
            list = cbll.GetListBySortId(key, page, pagesize, sort, area, price);
            count = cbll.GetListBySortId(key, sort, area, price);
        }
        public string GetPager()
        {
            return Pager.GetShowPager(count,pagesize,page,"");
        }
    }
}
